package com.example.warehouseplus.dao;

import com.example.warehouseplus.entity.Item;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@Repository
public interface ItemRepository extends ReactiveCrudRepository<Item, String> {

    // 根据名字查询
    Mono<Item> findByName(String name);

    // 根据名字删除
    Mono<Void> deleteByName(String name);

    // 根据价格区间查询
    Flux<Item> findByPriceBetween(double minPrice, double maxPrice);


}
